package com.bfsuol.bfsuolframework.security.dao;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bfsuol.bfsuolframework.core.entity.Entity;
import com.bfsuol.bfsuolframework.core.entity.EntitySupport;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * Created by andy on 2020/10/19.
 */
@Data
@TableName("t_sec_privilege")
@Accessors(chain = true)
public class Privilege extends EntitySupport implements Entity {

    @TableId(type = IdType.AUTO,value = "privilege_id")
    private Long id;
    @TableField(value = "privilege_title")
    private String privilegeTitle;//权限名称
    @TableField(value = "privilege_code")
    private String privilegeCode;//权限编码

    public boolean isNew() {
        return getId() == null || getId().longValue()<=0;
    }
}
